#ifndef ICHARACTER_HH
#define ICHARACTER_HH

#include <string> // For std::string
#include <vector> // Generally useful header, though not directly used by methods here

// Forward declaration of Item struct/class
// Assumes Item.hh exists (e.g., in include/items/)
struct Item;

/**
 * @interface ICharacter
 * @brief Interface for all character-like entities in the game.
 *
 * Provides a contract for entities (both players and enemies) to implement
 * basic actions like taking damage and attacking.
 */

class ICharacter
{
public:
    // Virtual destructor: Essential for proper cleanup in polymorphic hierarchies.
    // '= default' makes the compiler generate the default implementation.
    virtual ~ICharacter() = default;

    // --- Core Combat & Status ---

    /**
     * @brief Checks if the character is currently alive (health > 0).
     * @return true if the character is alive, false otherwise.
     */
    virtual bool isAlive() const = 0;

    /**
     * @brief Applies damage to the character, considering defense.
     * @param damage The amount of incoming damage before defense.
     * @return true if the character survived the damage, false otherwise.
     */
    virtual bool takeDamage(unsigned int damage) = 0;

    /**
     * @brief Makes this character attack a target character.
     * @param target The character being attacked.
     * @return true if the target survived the attack, false otherwise.
     */
    virtual bool attack(ICharacter &target) = 0;

    // --- Getters for Information ---

    /** @brief Gets the character's name. */
    virtual const std::string &getName() const = 0;

    /** @brief Gets the character's descriptive text. */
    virtual const std::string &getDescription() const = 0;

    /** @brief Gets the character's current health points. */
    virtual unsigned int getHealth() const = 0;

    /** @brief Gets the character's maximum health points. */
    virtual unsigned int getMaxHealth() const = 0;

    /** @brief Gets the character's attack power value. */
    virtual unsigned int getAttackPower() const = 0;

    /** @brief Gets the character's defense power value. */
    virtual unsigned int getDefensePower() const = 0;

    /** @brief Gets the character's maximum defense points. */
    virtual unsigned int getMaxdefensePower() const = 0;
    // --- Utility & Display ---

    /**
     * @brief Provides a concise string representation of the character's state.
     * @return A string summarizing the character.
     */
    virtual std::string toString() const = 0;

    /**
     * @brief Displays the character's detailed status to the console.
     */
    virtual void display() const = 0;

    // --- Inventory Management (Interface Requirement) ---

    /**
     * @brief Adds an item pointer to the character's inventory (if applicable).
     * @param item Pointer to the dynamically allocated Item to add. Ownership might be transferred.
     */
    virtual void addToInventory(Item *item) = 0;

    /**
     * @brief Displays the character's inventory contents to the console (if applicable).
     */
    virtual void displayInventory() const = 0;
};

#endif
